package com.example.blog.controller;

import com.example.blog.pojo.Picture;
import com.example.blog.service.PictureService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * name: 东北宋小宝
 * date: 2020/9/5
 */
@Controller
public class PictureShowController {
    @Resource
    PictureService pictureService;
    @GetMapping("/picture")
    public String toPircture(Model model){
        List<Picture> pictures = pictureService.getAllPicture();
        model.addAttribute("pictures",pictures);
        return "picture";
    }
}
